home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7571 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: ix.netcom.com!netnews
  2. From: miker3@ix.netcom.com (Mike Rubenstein)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: pointers
  5. Date: Tue, 27 Feb 1996 14:42:37 GMT
  6. Organization: Netcom
  7. Message-ID: <3133179a.53490495@nntp.ix.netcom.com>
  8. References: <4gqh8g$bo4@news.bu.edu> <Pine.A32.3.91.960225212528.135696D-100000@red.weeg.uiowa.edu>
  9. NNTP-Posting-Host: ix-dc12-08.ix.netcom.com
  10. X-NETCOM-Date: Tue Feb 27  6:42:27 AM PST 1996
  11. X-Newsreader: Forte Agent .99d/32.182
  12.  
  13. The Amorphous Mass <robinson@blue.weeg.uiowa.edu> wrote:
  14.  
  15. > On 25 Feb 1996, wai yip wrote:
  16. > > can someone who knows a lot about pointers help me with this
  17. > > 
  18. > > int i=3,*p;
  19. > > 
  20. > > with the above declaration, what would the bottom lines do?
  21. > > *p=&i;
  22. >   Set the value p points to to i's address, which will result in an 
  23. > implementation-defined conversion from pointer value to integer.  This is 
  24. > seldom desired.  If this assignment immediately follows the above 
  25. > declaration (so that p doesn't point to any legal location) then the 
  26. > results of this statement are undefined.  This is never desired.
  27.  
  28. This is not an automatic conversion and a diagnostic is required since
  29. it violates a constraint in 6.3.16.1.
  30.  
  31. > > p=i;
  32. >   Sets p to the value of i.  This forces conversion of an int (3) to a 
  33. > pointer value, the results of which are again implementation defined.  
  34. > This too is seldom desired.
  35.  
  36. This is not an automatic conversion and a diagnostic is required since
  37. it violates a constraint in 6.3.16.1.
  38.  
  39.  
  40. Michael M Rubenstein
  41.